/**
 * http://en.wikipedia.org/wiki/Factory_method_pattern
 * @author Laci
 *
 */
public class SpeechFactory {
	
	public static Speech create(SpeechType type, String name) {
		switch(type) {
			case Normal:
				return new NormalSpeech(name);
			case Double:
				return new DoubleSpeech(name);
			case Shouting:
				return new ShoutingSpeech(name);
		}
		throw new IllegalArgumentException("The speech type " 
				+ type + " is not recognized.");
	}
	
}
